package org.nstack.header.network.l2;

import org.springframework.http.HttpMethod;
import org.nstack.header.message.APIParam;
import org.nstack.header.rest.RestRequest;


@RestRequest(
        path = "/l2-networks/vlan",
        method = HttpMethod.POST,
        responseClass = APICreateL2VlanNetworkEvent.class,
        parameterName = "params"
)
public class APICreateL2VlanNetworkMsg extends APICreateL2NetworkMsg {

    @APIParam(numberRange = {1, 4094})
    private Integer vlan;

    public int getVlan() {
        return vlan;
    }

    public void setVlan(int vlan) {
        this.vlan = vlan;
    }

    @Override
    public String getType() {
        return L2NetworkConstant.L2_VLAN_NETWORK_TYPE;
    }
 
    public static APICreateL2VlanNetworkMsg __example__() {
        APICreateL2VlanNetworkMsg msg = new APICreateL2VlanNetworkMsg();

        msg.setName("Test-Net");
        msg.setVlan(10);
        msg.setDescription("Test");
        msg.setZoneUuid(uuid());
        msg.setPhysicalInterface("eth0");

        return msg;
    }

}
